﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CApFLEXRetractSystemAttachmentType3
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands;

public class CApFLEXRetractSystemAttachmentType3 : CApFLEXRetractSystemAttachment
{
  private readonly TxCableRetractSystemAttachmentType3 m_retractSystemAttachmentType3;

  public CApFLEXRetractSystemAttachmentType3(ICApCableExtentDescriptor cableExtentDescriptor)
    : base(cableExtentDescriptor)
  {
    this.m_retractSystemAttachmentType3 = new TxCableRetractSystemAttachmentType3();
  }

  public CApFLEXRetractSystemAttachmentType3(
    ITxCable cable,
    TxCableRetractSystemAttachmentType3 retractSystemAttachmentType3)
    : base(cable)
  {
    this.m_retractSystemAttachmentType3 = retractSystemAttachmentType3;
  }

  protected override TxCableRetractSystemAttachment RetractSystemAttachment
  {
    get => (TxCableRetractSystemAttachment) this.m_retractSystemAttachmentType3;
  }

  public override bool DoesUseFrame(ITxLocatableObject frame)
  {
    if (base.DoesUseFrame(frame))
      return true;
    return frame != null && frame == this.SecondaryFixedFrame;
  }

  public ITxLocatableObject SecondaryFixedFrame
  {
    get => (this.Attachment as TxCableRetractSystemAttachmentType3).SecondaryFixedFrame;
    set => (this.Attachment as TxCableRetractSystemAttachmentType3).SecondaryFixedFrame = value;
  }

  public double SecondaryLengthFromStart
  {
    get => (this.Attachment as TxCableRetractSystemAttachmentType3).SecondaryLengthFromStart;
    set
    {
      (this.Attachment as TxCableRetractSystemAttachmentType3).SecondaryLengthFromStart = value;
      this.NotifyPropertyChanged(nameof (SecondaryLengthFromStart));
    }
  }

  public override ITxLocatableObject ClosestFrameToStart => this.SecondaryFixedFrame;

  public override double LowerLengthFromStart => this.SecondaryLengthFromStart;

  public override double RetractionCapability => this.MaxRetractedLength - this.MinRetractedLength;
}
